import {reactive} from "vue";
import type {DialogProps} from "@/components/dialog/type.ts";

export default function useDialog() {
    //定义弹框属性
    const dialog= reactive<DialogProps>({
        title: '标题',
        width: 630,
        height: 280,
        visible: false,
    })
    // 展示
    const onShow = ()=>{
        dialog.visible = true
    }
    // 关闭
    const onClose = ()=> {
        dialog.visible = false
    }

    // 确定
    const onConfirm = ()=> {
        dialog.visible = false
    }

    return {
        dialog,
        onShow,
        onClose,
        onConfirm
    }


}
